<include file="public:header"/>
<script language="javascript" type="text/javascript" src="__ROOT__/statics/js/jquery/plugins/formvalidator.js"></script>
<script language="javascript" type="text/javascript" src="__ROOT__/statics/js/jquery/plugins/formvalidatorregex.js"></script>
<link href="__ROOT__/statics/css/formvalidator.css" rel="stylesheet" type="text/css" />
<load href="__TMPL__public/css/uc.css" />
<load href="__ROOT__/statics/js/dateselect.js" />
<load href="__ROOT__/statics/js/area.js" />
<div class="middle">
    <div class="uc clearfix"> <include file="left_region"/>
        <div class="right_region account">
			<present name="err">
            <div class="err"  style="width:150px;">
		        <div class="icon_{$err.err}">{$err.msg}</div>                
            </div>
            </present> 
            <form action="" method="post" name="myform" id="myform" enctype="multipart/form-data">
                <table>
                    <tr>
                        <th style="width:100px;">
                            昵称：</th>
                        <td><input type="text" name="name" id="name" value="{$user.name}" class="input_text"/><span class="required">*</span></td>
                    </tr>
                    <tr>
                        <th>邮箱：</th>
                        <td><input type="text" name="email" id="email" value="{$user.email}" class="input_text"/></td>
                    </tr>
                    <tr>
                        <th>头像：</th>
                        <td>
                            <if condition="trim($user['img']) neq ''">
                                <img src="{$user.img}" width="40" height="40"/>
                            <else/>
                                <img src="__TMPL__/public/images/avatar-60.png" width="40" height="40"/>
                            </if>                        	
                        	<input type="file"  name="img" id="img"/>    
                       	</td>
                    </tr>
                    <tr>
                        <th>性别：</th>
                        <td><input type="radio" name="sex" value="0"/>
                            男
                            <input type="radio" name="sex" value="1"/>
                            女
                            <input type="radio" name="sex" value="2"/>
                            保密 </td>
                    </tr>
                    <tr>
                        <th>生日：</th>
                        <td><select id="J_Year" name="year">
                            </select>
                            <select id="J_Month" name="month">
                            </select>
                            <select id="J_Day" name="day">
                            </select></td>
                    </tr>
                    <tr>
                        <th>所在地：</th>
                        <td><select id="J_Province" name="province">
                            </select>
                            <select id="J_City" name="city">
                            </select></td>
                    </tr>
                    <tr>
                        <th>个人博客：</th>
                        <td><input type="text" name="blog" value="{$user.blog}" class="input_text"/></td>
                    </tr>
                    <tr>
                        <th>自我介绍：</th>
                        <td><textarea style="width:300px;height:100px;" name="info">{$user.info}</textarea></td>
                    </tr>
                    <tr>
                        <th></th>
                        <td><input type="submit" class="submit" value="确定" name="dosubmit"/></td>
                    </tr>
                </table>
                <input type="hidden" name="id" value="{$user.id}"/>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
var sex=$.trim("{$user.sex|default='0'}");
var brithday=$.trim("{$user.brithday}");
var address=$.trim("{$user.address}");

$(function(){ 
		   
	/*
	setTimeout(function(){ 
		$('.err').fadeOut();
	},3000);
	*/
	$.formValidator.initConfig({formid:"myform",autotip:true,
		onerror:function(msg,obj){
			art.dialog({content:msg,lock:true,width:'200',height:'50'}, 
					   function(){this.close();$(obj).focus();})
			}
	});
		
	$("#name").formValidator({onshow:"填写昵称",onfocus:"6个字符以上"})
		.inputValidator({min:6,onerror:"6个字符以上"});
		
	$("input[name='sex'][value='"+sex+"']").attr("checked","checked");
	//出生日期
	var year = 1985;
	var month = 1;
	var day = 1;	
	if(brithday != null){
	  	var bths = brithday.split("|");
	  	year = bths[0];
	  	month = bths[1];
	  	day = bths[2];
	}
	var ds = new DateSelector("J_Year", "J_Month", "J_Day", 
		{Year: year, Month: month, Day: day, MinYear: new Date().getFullYear() -100, MaxYear: new Date().getFullYear() });	
	//所在地
	var pro = "请选择";
	var city = "请选择";
	if(address != null){
	  var adds = address.split("|");
	  pro = adds[0];
	  city = adds[1];
	}
	setup(pro,city);	
	
});
</script>
<include file="public:footer"/> 